/**
 * 
 */
package com.onstar.cn.map.sorter;

import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;

/**
 * @author Qiying Gong
 *
 * @Created 2013-4-11
 */
public class CoordinatesSorter implements Comparator<Integer> {

	/* (non-Javadoc)
	 * @see java.util.Comparator#compare(java.lang.Object, java.lang.Object)
	 */
	@Override
	public int compare(Integer a, Integer b) {
		if (a < b) {
			return -1;
		}else if (a > b){
			return 1;
		}
		
		return 0;
	}

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		List<Integer> list = new ArrayList<Integer>();
		list.add(2);
		list.add(1);
		Collections.sort(list, new CoordinatesSorter());

	}

}
